/**
 * 
 */
package cn.softTank.BpelModelImpl;

import org.dom4j.DocumentHelper;
import org.dom4j.Element;

import cn.softTank.BpelModel.Link;
import cn.softTank.BpelModel.Target;

/**
 * @author Yuzone (smartzxy@gmail.com)
 * 
 */
public class TargetImpl implements Target {

	private Link link;

	/*
	 * (non-Javadoc)
	 * 
	 * @see cn.softTank.BpelModel.Target#getLink()
	 */
	@Override
	public Link getLink() {
		return link;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see cn.softTank.BpelModel.Target#setLinkName(cn.softTank.BpelModel.Link)
	 */
	@Override
	public void setLink(Link link) {
		this.link=link;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see cn.softTank.BpelModel.XmlAdapt#toElement()
	 */
	@Override
	public Element toElement() {
		Element e=DocumentHelper.createElement("target");
		if(link!=null)
			e.addAttribute("linkName", link.getName());
		return e;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see cn.softTank.BpelModel.XmlAdapt#toXml()
	 */
	@Override
	public String toXml() {
		// TODO Auto-generated method stub
		return null;
	}

}
